package com.upb.webserver.common.pojo.message;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class RspMessageRecipientVO implements Comparable {
    private Integer id;
    private String messageContent;
    private Byte type;
    private Byte status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtCreate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtModified;

    @Override
    public int compareTo(Object o) {
        if (o instanceof RspMessageRecipientVO) {
            RspMessageRecipientVO s = (RspMessageRecipientVO) o;
            if (this.id > s.id) {
                return -1;
            } else if (this.id.equals(s.id)) {
                return 0;
            } else {
                return 1;
            }
        }
        return 0;
    }
}
